package com.example.demo.service;

import com.example.demo.entity.DAccessory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.exception.bizException.BizException;

import java.util.List;

/**
* <p>
*  服务类
* </p>
*
* @author cy
* @since 2020-08-01
*/
public interface DAccessoryService {

    /**
    * 分页查询DAccessory
    *
    * @param page     当前页数
    * @param pageSize 页的大小
    * @param factor  搜索关键词
    * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果
    * @author cy
    * @since 2020-08-01
    */
    Page<DAccessory> listDAccessorysByPage(int page, int pageSize, String factor);

    /**
    * 根据id查询DAccessory
    *
    * @param id 需要查询的DAccessory的id
    * @return 返回对应id的DAccessory对象
    * @author cy
    * @since 2020-08-01
    */
    DAccessory getDAccessoryById(int id);

    /**
     * 根据id查询DAccessory
     *
     * @param id 需要查询的DAccessory的Did
     * @return 返回对应id的DAccessory对象
     * @author cy
     * @since 2020-08-01
     */
    List<DAccessory> getDAccessoryByDId(int id);


    /**
    * 插入DAccessory
    *
    * @param dAccessory 需要插入的DAccessory对象
    * @return 返回插入成功之后DAccessory对象的id
    * @author cy
    * @since 2020-08-01
    */
    int insertDAccessory(DAccessory dAccessory);

    /**
    * 根据id删除DAccessory
    *
    * @param id 需要删除的DAccessory对象的id
    * @return 返回被删除的DAccessory对象的id
    * @author cy
    * @since 2020-08-01
    */
    int deleteDAccessoryById(int id);

    /**
    * 根据id更新DAccessory
    *
    * @param dAccessory 需要更新的DAccessory对象
    * @return 返回被更新的DAccessory对象的id
    * @author cy
    * @since 2020-08-01
    */
    int updateDAccessory(DAccessory dAccessory);

}
